home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
learnapi
/
main.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1998-07-04
|
33KB
|
751 lines
VERSION 5.00
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "LearnAPI"
ClientHeight = 3780
ClientLeft = 255
ClientTop = 1035
ClientWidth = 2760
Icon = "Main.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3780
ScaleWidth = 2760
Begin VB.CommandButton cmdRun
Caption = "&Run"
Height = 375
Left = 120
TabIndex = 7
Top = 720
Width = 2535
End
Begin VB.ComboBox cboAPIFunction
Height = 315
Left = 120
Style = 2 'Dropdown List
TabIndex = 5
Top = 360
Width = 2535
End
Begin VB.Frame fraGroup
Caption = "ShellExecute Function"
Height = 855
Index = 1
Left = 120
TabIndex = 2
Top = 2520
Width = 2415
Begin VB.Label lblURL
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Longonot Software Web-Site"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 195
Left = 120
MouseIcon = "Main.frx":030A
MousePointer = 99 'Custom
TabIndex = 4
Top = 240
Width = 2055
End
Begin VB.Label lblMailto
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "longonot@intekom.co.za"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 195
Left = 240
MouseIcon = "Main.frx":045C
MousePointer = 99 'Custom
TabIndex = 3
Top = 480
Width = 1770
End
End
Begin VB.Timer tmrFlashWindow
Enabled = 0 'False
Interval = 200
Left = 2400
Top = 0
End
Begin VB.Label lblDiscription
BorderStyle = 1 'Fixed Single
Caption = "Discription of API function."
Height = 1215
Left = 120
TabIndex = 8
Top = 1200
Width = 2535
WordWrap = -1 'True
End
Begin VB.Label lblSelectFunction
AutoSize = -1 'True
Caption = "Select an API Function:"
Height = 195
Left = 120
TabIndex = 6
Top = 120
Width = 1680
End
Begin VB.Label lblCredits
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "About / Credits"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 195
Left = 120
MouseIcon = "Main.frx":05AE
MousePointer = 99 'Custom
TabIndex = 1
Top = 3480
Width = 1305
End
Begin VB.Label lblExit
BackStyle = 0 'Transparent
Caption = "Exit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 255
Left = 1560
MouseIcon = "Main.frx":0700
MousePointer = 99 'Custom
TabIndex = 0
Top = 3480
Width = 375
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim CustomColors() As Byte 'Variable to hold custom colours
Dim RunningInIDE As Boolean 'Used to hold running in IDE or not
Private Sub cSetWindowPos()
Dim flags%, lResult&
Static Invert As Boolean
flags = SWP_NOSIZE Or SWP_NOMOVE
If Invert = False Then
lResult = SetWindowPos(frmMain.hwnd, HWND_TOPMOST, 0, 0, 0, 0, flags)
Invert = True
ElseIf Invert = True Then
lResult = SetWindowPos(frmMain.hwnd, HWND_NOTTOPMOST, 0, 0, 0, 0, flags)
Invert = False
End If
End Sub
Private Sub cGetOpenFileName()
'The code to call the Open Dialog box is in the
'fGetOpenFileName function
Dim Path$, Filter$
Filter = "All Files (*.*)" & Chr(0) & "*.*" & Chr(0)
Path = fGetOpenFileName(Filter)
If Path <> "Cancel" Then
MsgBox "You selected " & Path, vbOKOnly + vbInformation, "LearnAPI"
End If
End Sub
Private Sub cGetFileAttributes()
Dim Path$, Filter$, Att&, Msg$
On Error GoTo OpenError
Filter = "All Files (*.*)" & Chr(0) & "*.*" & Chr(0)
Path = fGetOpenFileName(Filter)
If Path <> "Cancel" Then
Att = GetFileAttributes(Path)
If (Att And FILE_ATTRIBUTE_ARCHIVE) <> 0 Then Msg = Msg & "Archive" & vbCrLf
If (Att And FILE_ATTRIBUTE_COMPRESSED) <> 0 Then Msg = Msg & "Compressed" & vbCrLf
If (Att And FILE_ATTRIBUTE_DIRECTORY) <> 0 Then Msg = Msg & "Directory" & vbCrLf
If (Att And FILE_ATTRIBUTE_HIDDEN) <> 0 Then Msg = Msg & "Hidden" & vbCrLf
If (Att And FILE_ATTRIBUTE_NORMAL) <> 0 Then Msg = Msg & "Normal" & vbCrLf
If (Att And FILE_ATTRIBUTE_READONLY) <> 0 Then Msg = Msg & "Read only" & vbCrLf
If (Att And FILE_ATTRIBUTE_SYSTEM) <> 0 Then Msg = Msg & "System" & vbCrLf
MsgBox "The file attributes for " & Path & " are:" & vbCrLf & vbCrLf & Msg, vbOKOnly + vbInformation, "LearnAPI"
End If
Exit Sub
OpenError:
MsgBox "Could not find file attributes.", vbOKOnly + vbExclamation, "LearnAPI"
End Sub
Private Sub cGetCursorPos()
Dim v As POINTAPI, Success&
Success = GetCursorPos(v)
MsgBox "The mouse coordinates are: " & v.X & ", " & v.Y, vbOKOnly + vbInformation, "LearnAPI"
End Sub
Private Sub cFindExecutable()
Dim OpenFile As OPENFILENAME
Dim Success As Long, FileTitleLength%, Filter$
Dim Result$, X&, DirLen#, FileLen#, Dir$
On Error GoTo OpenError
'The following lines open the Open Dialog box using API calls
OpenFile.lStructSize = Len(OpenFile)
OpenFile.hwndOwner = frmMain.hwnd
OpenFile.hInstance = App.hInstance
Filter = "All Files (*.*)" & Chr(0) & "*.*" & Chr(0)
OpenFile.lpstrFilter = Filter
OpenFile.nFilterIndex = 1
OpenFile.lpstrFile = String(257, 0)
OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1
OpenFile.lpstrFileTitle = OpenFile.lpstrFile
OpenFile.nMaxFileTitle = OpenFile.nMaxFile
OpenFile.lpstrTitle = "LearnAPI - Open Dialog Box"
OpenFile.flags = 0
Success = GetOpenFileName(OpenFile)
If Success = 0 Then
Exit Sub
Else:
'The next 4 lines remove null length strings.
'Trim does not work. Anyone got a better idea?
lblDiscription.ToolTipText =